package com.jrx.anytxn.param.job.cutover.step;

import com.jrx.anytxn.param.entity.PrOrganizationTable;
import com.jrx.anytxn.param.mapper.ext.ExtPrOrganizationTableMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 日切结束写
 *
 * @author : zhenghaopu
 * 2019/11/18
 */
@Service
public class CutoverEndWriter implements ItemWriter<PrOrganizationTable> {

    @Autowired
    private ExtPrOrganizationTableMapper extPrOrganizationTableMapper;

    @Override
    public void write(List<? extends PrOrganizationTable> items) {
        if(CollectionUtils.isNotEmpty(items)){
            extPrOrganizationTableMapper.batchUpdate((List<PrOrganizationTable>) items);
        }
    }
}
